﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace LuoYi.Admin.Entities;

/// <summary>
/// 部门表
/// </summary>
[Table("sys_dept")]
public class SysDept : IEntity
{
    /// <summary>
    /// 部门id
    /// </summary>
    [Key]
    [Column("dept_id", TypeName = "bigint(20)")]
    public long DeptId { get; set; }

    /// <summary>
    /// 父部门id
    /// </summary>
    [Column("parent_id", TypeName = "bigint(20)")]
    public long? ParentId { get; set; }

    /// <summary>
    /// 祖级列表
    /// </summary>
    [Column("ancestors")]
    [StringLength(50)]
    public string? Ancestors { get; set; }

    /// <summary>
    /// 部门名称
    /// </summary>
    [Column("dept_name")]
    [StringLength(30)]
    public string? DeptName { get; set; }

    /// <summary>
    /// 显示顺序
    /// </summary>
    [Column("order_num", TypeName = "int(4)")]
    public int? OrderNum { get; set; }

    /// <summary>
    /// 负责人
    /// </summary>
    [Column("leader")]
    [StringLength(20)]
    public string? Leader { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>
    [Column("phone")]
    [StringLength(11)]
    public string? Phone { get; set; }

    /// <summary>
    /// 邮箱
    /// </summary>
    [Column("email")]
    [StringLength(50)]
    public string? Email { get; set; }

    /// <summary>
    /// 部门状态（0正常 1停用）
    /// </summary>
    [Column("status")]
    [StringLength(1)]
    public string? Status { get; set; }

    /// <summary>
    /// 删除标志（0代表存在 2代表删除）
    /// </summary>
    [Column("del_flag")]
    [StringLength(1)]
    public string? DelFlag { get; set; }

    /// <summary>
    /// 创建者
    /// </summary>
    [Column("create_by")]
    [StringLength(64)]
    public string? CreateBy { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column("create_time", TypeName = "datetime")]
    public DateTime? CreateTime { get; set; }

    /// <summary>
    /// 更新者
    /// </summary>
    [Column("update_by")]
    [StringLength(64)]
    public string? UpdateBy { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    [Column("update_time", TypeName = "datetime")]
    public DateTime? UpdateTime { get; set; }
}
